<div class="modal" tabindex="-1">
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
  <div class="modal-md col-md-5 col-md-offset-3">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" ng-click="$hide()">
          <span>&times;</span></button>
        <h4>Modify Processor
          <span ng-bind="processorId"></span></h4>
      </div>
      <div class="modal-body">
        <p style="padding-top: 4px; padding-bottom: 14px;">System will replace existing processor
          with a new one, if any of these fields (processor JAR, task class or parallelism) are
          changed.</p>

        <div ng-show="shouldNoticeSubmitFailed">
          <div class="alert alert-danger alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert"
                    ng-click="shouldNoticeSubmitFailed=false">
              <span aria-hidden="true">&times;</span></button>
            Failed to modify the DAG.
            <span ng-if="reason">
              Check out the
              <span class="help-text"
                    bs-tooltip="error" html="true" placement="bottom">reason</span>.
            </span>
          </div>
        </div>

        <form name="form" class="form-horizontal">
          <!-- right margin align to cancel button right -->
          <div style="margin-bottom: 18px">
            <!-- input 1 -->
            <form-control
              ng-hide="changeParallelismOnly"
              type="upload" label="Processor JAR" autofocus="true"
              ng-model="jar" accept-pattern=".jar"></form-control>
            <!-- input 2 -->
            <form-control
              ng-hide="changeParallelismOnly"
              type="class" label="Task Class"
              ng-model="taskClass"
              invalid="invalid.taskClass"></form-control>
            <!-- input 3 -->
            <form-control
              ng-hide="changeParallelismOnly"
              type="text" label="Description"
              ng-model="description"
              invalid="invalid.description"></form-control>
            <!-- input 4 -->
            <form-control
              type="integer" min="1" label="Parallelism"
              ng-model="parallelism"
              invalid="invalid.parallelism"></form-control>
            <!-- input 5 -->
            <form-control
              type="datetime" label="Transit Time"
              help="The modification will take effect immediately, if transition time is not specified or past already."
              ng-model="transitTime"
              invalid="invalid.transitTime"></form-control>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm"
                ng-disabled="!canReplace()" ng-click="submit()">
          <span ng-show="uploading"
                class="glyphicon glyphicon-repeat rotate-animation"></span>
          Change
        </button>
        <button type="button" class="btn btn-default btn-sm" ng-click="$hide()">Cancel</button>
      </div>
    </div>
  </div>
</div>
